Component({
  data: {
    value: 'home',
    list: [
      { value: 'home', label: '首页',icon: 'home',pagePath:'/pages/home/home' },
      { value: 'user', label: '我的',icon: 'user',pagePath:'/pages/account/account'  },
    ],
  },
  methods: {
    onChange(e) {
      const tabValue = e.detail.value
      const currentPath = this.data.list.find(row=>row.value === tabValue).pagePath
      wx.switchTab({
        url: currentPath,
      })
      this.setData({
        value: tabValue
      })
    },
  },
});